a11y: Compute the cell index quicker
authorBenjamin Otte <otte@redhat.com>
Sat, 12 Nov 2011 04:24:32 +0000 (05:24 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2011 03:39:24 +0000 (04:39 +0100)
We have the node available, so we can compute it from there.

gtk/a11y/gtktreeviewaccessible.c

index d5648a5f9446825208778c072195f2ae55aff8d6..0680a946a9aa66eff1ef4d0feac3134455fe950e 100644 (file)
@@ -3018,17 +3018,11 @@ static int
 cell_info_get_index (GtkTreeView                     *tree_view,
                      GtkTreeViewAccessibleCellInfo   *info)
 {
-  GtkTreePath *path;
-  gint column_number;
   int index;
 
-  path = cell_info_get_path (info);
-  if (!path)
-    return -1;
-
-  column_number = get_column_number (tree_view, info->cell_col_ref, FALSE);
-  index = get_index (tree_view, path, column_number);
-  gtk_tree_path_free (path);
+  index = _gtk_rbtree_node_get_index (info->tree, info->node) + 1;
+  index *= info->view->n_cols;
+  index += get_column_number (tree_view, info->cell_col_ref, FALSE);
 
   return index;
 }